/*
 * Copyright © OpenAtom Foundation.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package io.iec.edp.caf.databaseobject.rttest.api;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * @author liu_wei
 */
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface IDatabaseObjectRtTestService {

    @GET
    @Path("dt/{id}")
    Response getDtDatabaseById(@PathParam("id")String id);

    @GET
    @Path("dtsu/id/{id}/{su}")
    Response getSuDtDatabaseById(@PathParam("id")String id, @PathParam("su")String su);

    /**
     * 获取运行时dbo
     *
     * @return 数据库对象
     */
    @GET
    @Path("rtsu/id/{id}/{su}")
    Response getDatabaseObject(@PathParam("id")String id, @PathParam("su")String su);

    /**
     * 根据数据库对象编号获取数据库对象
     *
     * @return 数据库对象列表
     */
    @GET
    @Path("rtsu/code/{code}/{su}")
    Response getDatabaseObjectByCode(@PathParam("code")String code, @PathParam("su")String su);

    /**
     * 获取默认DBO实体列表
     *
     * @return DBO实体列表
     */
//    @GET
//    @Path("rtsu/all/{su}")
//    Response getDatabaseObjectList(@PathParam("su")String su);


    /**
     * 获取设计时DBO
     *
     * @return DBO
     */
    @GET
    @Path("dtsu/code/{code}/{su}")
    Response getDtDatabaseObjectByCode(@PathParam("code")String code, @PathParam("su")String su);

    /**
     * 保存
     *
     * @return RPC结果
     */
    @POST
    @Path("dtsu/save/{id}/{su}")
    Response saveDtDatabaseObject(@PathParam("id")String id, @PathParam("su")String su);

    /**
     * 删除
     *
     * @return RPC结果
     */
    @DELETE
    @Path("dtsu/delete/{id}/{su}")
    Response deleteDtDatabaseObject(@PathParam("id")String id, @PathParam("su")String su);

    /**
     * 根据Id判断设计时DBO是否存在
     *
     * @return 结果
     */
    @GET
    @Path("dtsu/exist/{id}/{su}")
    Response isExistDatabaseObjectDt(@PathParam("id")String id, @PathParam("su")String su);

    /**
     * 部署单个DBO
     *
     * @return RPC结果
     */
    @GET
    @Path("dtsu/sigle/{id}/{su}")
    Response deployDatabaseObject(@PathParam("id")String id, @PathParam("su")String su);

    /**
     * 部署多个DBO
     *
     * @return 部署结果
     */
    @GET
    @Path("dtsu/multiple/{id}/{su}")
    Response deployDatabaseObjects(@PathParam("id")String id, @PathParam("su")String su);


    /**
     * 部署临时表DBO
     *
     * @return 部署结果
     */
    @GET
    @Path("dtsu/multiple/{dboid}")
    Response deployTempTableDatabaseObjects(@PathParam("dboid")String dboid);


    /**
     * 部署事务临时表DBO
     *
     * @return 部署结果
     */
    @GET
    @Path("dtsu/Transaction/{dboid}")
    Response deployTransactionTempTableDatabaseObjects(@PathParam("dboid")String dboid);

}
